package com.xiaoqi.store.entity;

import lombok.*;

import java.util.Objects;

/**
 * @Author Rookie Coder
 * @Description 省市区
 * @Date
 **/
public class DistrictsEntity {

    private Integer id;// 主键id
    private Integer parent; // 父级编号
    private Integer code; // 自己的编号
    private String name; // 省市区名字

    public DistrictsEntity(Integer id, Integer parent, Integer code, String name) {
        this.id = id;
        this.parent = parent;
        this.code = code;
        this.name = name;
    }

    public DistrictsEntity() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getParent() {
        return parent;
    }

    public void setParent(Integer parent) {
        this.parent = parent;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof DistrictsEntity)) return false;
        DistrictsEntity that = (DistrictsEntity) o;
        return Objects.equals(getId(), that.getId()) &&
                Objects.equals(getParent(), that.getParent()) &&
                Objects.equals(getCode(), that.getCode()) &&
                Objects.equals(getName(), that.getName());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId(), getParent(), getCode(), getName());
    }

    @Override
    public String toString() {
        return "DistrictsEntity{" +
                "id=" + id +
                ", parent=" + parent +
                ", code=" + code +
                ", name='" + name + '\'' +
                '}';
    }
}
